package net.melon.uploader.service;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;

import javax.annotation.PostConstruct;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;

import net.esj.basic.dao.jdbc.JdbcDao;
import net.esj.basic.utils.StringUtils;
import net.melon.jdbc.core.RowMapper;

@Singleton
@Named("uploader.UploaderService")
public class UploaderService{

	private JdbcDao jdbcDao;
	
	private static final Map<String,String> cache = new HashMap<String, String>();
	
	@PostConstruct
	public void load(){
		cache.clear();
	}
	
	/**
	 * 获得该配置KEY对与的子路径
	 * @param key
	 * @return
	 */
	public static String getPath(String key){
		String path =  cache.get(key);
		if(StringUtils.hasText(path)){
			return path;
		}else{
			return key;
		}
	}
	
	@Inject
	public void setJdbcDao(JdbcDao jdbcDao) {
		this.jdbcDao = jdbcDao;
	}
	
}

